package day1;
import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class MApTest3 {
    public static void main(String[] args) {
        Map<Pet,String> m=new HashMap<>();//TreeMap
        m.put(new Pet("哮天犬",9999,9999),"二郎神");
        m.put(new Pet("二黄",44,66),"孙楠楠");
        m.put(new Pet("大黄",66,77),"wangkaixuan");
        m.put(new Pet("半人马",55,11),"殷果");
        System.out.println(m.size());
        m.put(new Pet("半人马",99,99),"江浩浩");
        System.out.println(m.size());
        Set<Map.Entry<Pet, String>> v = m.entrySet();
        for (Map.Entry<Pet, String> o : v) {
            System.out.println(o.getKey()+" 他的主子是 "+o.getValue());
        }

    }
}
